package ch.uzh.ifi.seal.ssqa.ui.providers;

import org.eclipse.jface.viewers.LabelProvider;
import org.eclipse.swt.SWT;
import org.eclipse.swt.graphics.Image;
import org.eclipse.swt.widgets.Display;

import ch.uzh.ifi.seal.ssqa.model.DiagramComponent;
import ch.uzh.ifi.seal.ssqa.model.Source;

public class SourceNameLabelProvider extends LabelProvider {
	@Override
	public String getText(Object element) {
		if (element instanceof DiagramComponent){
			return ((DiagramComponent) element).getName();
		} else if(element instanceof Source){
			return ((Source)element).getName();
		} else {
			return "undefined label";
		}
	}
	
	final Image image = Display.getDefault().getSystemImage(SWT.ICON_WARNING);

	@Override
	public Image getImage(Object element){
		return null;
	}
}

